package net.ib.rpc.message;

import net.ib.mn.protocol.CommonEnvelope.EnvelopeType;

import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.Message;

/**
 * m&talk server timeout RpcRequestInfo
 * 
 * @author zagals@infobank.net
 * @version 1.0
 * @since 11/02/24
 * @history
 */
public class RpcRequestInfo extends RequestInfo {
	private final Message body;
	private final EnvelopeType type;
	private final MethodDescriptor method;
	private final int requestId;
	private final int methodId;
	private final RpcResponseInfo requestContext;

	public RpcRequestInfo(Message body, EnvelopeType type,
			MethodDescriptor method, RpcResponseInfo requestContext,
			int requestId, int methodId, long deadline) {

		super(deadline);

		this.body = body;
		this.type = type;
		this.method = method;
		this.requestContext = requestContext;
		this.requestId = requestId;
		this.methodId = methodId;
	}

	public RpcResponseInfo getResponseInfo() {
		return requestContext;
	}

	public int getRequestId() {
		return requestId;
	}

	public int getMethodId() {
		return methodId;
	}

	public Message getBody() {
		return body;
	}

	public EnvelopeType getType() {
		return type;
	}

	public MethodDescriptor getMethod() {
		return method;
	}
}
